package zhouzhouyongche.action;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.alibaba.fastjson.JSON;
import com.opensymphony.xwork2.ActionSupport;

import zhouzhouyongche.model.Seat;
import zhouzhouyongche.service.SeatService;

@Controller
@Action(value = "seat")
public class SeatAction extends BaseAction {
	
	private static final long serialVersionUID = 1L;
	
	@Autowired
	private SeatService seatService;
	
	private int ticketId;
	
	public void querySeat(){
		List<Seat> list = seatService.querySeat(ticketId);
		writeJson(list.size(), list);
	}

	public int getTicketId() {
		return ticketId;
	}

	public void setTicketId(int ticketId) {
		this.ticketId = ticketId;
	}
	
}
